const app = getApp()

Page({
  data: {
    page: 1,
    pageSize:10,
    pageTotal: 1,
    usersList: [{
      _id:1001,
      nickName:"test",
      phoneNumber:"13333334444",
      timeStr:"2023-10-19 11:11:11"
    },{
      _id:1002,
      nickName:"test2",
      phoneNumber:"13333334444",
      timeStr:"2023-10-19 11:11:11"
    },{
      _id:1003,
      nickName:"test3",
      phoneNumber:"13333334444",
      timeStr:"2023-10-19 11:11:11"
    }],
    catesList:[],
    showCateDlg:false,
    cols: [{colLabel:  "用户ID",colKey:"_id",width:20},
    {colLabel:  "用户昵称",colKey:"nickName",width:20},
    {colLabel:  "手机号码",colKey:"phoneNumber",width:20},
    {colLabel:  "注册时间",colKey:"timeStr",width:20},{colLabel:  "操作",colKey:"_op",width:30,btnConfig:[{
      "btnName":"编辑","btnType":"primary","bindType":"editItem"
    },{
      "btnName":"详情","btnType":"primary","bindType":"detailItem"
    },{
      "btnName":"删除","btnType":"primary","bindType":"removeItem"
    }]}],
    editUser:{},
    queryCondition:{
    }
  },
  onLoad() {
    wx.setWindowSize({
      height: 384,
      width: 683,
    })
  },
  pagChange(e){
    wx.showToast({
      title: 'click change page',
    })
  },handleRemove(e){
    wx.showModal({
      title: 'click remove row:'+e.detail.selectIndex,
    })
  },handleDetail(e){
    wx.showModal({
      title: 'click detail row:'+e.detail.selectIndex,
    })
  },handleEdit(e){
    wx.showModal({
      title: 'click edit row:'+e.detail.selectIndex,
    })
  },searchData(e){
    const data = e.detail.value
    wx.showModal({
      title: 'search it '+data.uphone,
    })
  }
})
